package com.ccf.business.etl.model.vo;

import cn.hutool.core.date.DateUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 用于数据概览 任务统计
 * @author zhaoj
 * @create 2021/12/8
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ApiModel(value="TopTenCountVO对象", description="")
public class TopTenCountVO {

    public TopTenCountVO(String name, String creator, Long elapsedTime) {
        this.name = name;
        this.creator = creator;
        this.elapsedTime = elapsedTime;
    }

    @ApiModelProperty(value = "任务名称")
    private String name;

    @ApiModelProperty(value = "创建人")
    private String creator;

    @ApiModelProperty(value = "时长")
    private Long elapsedTime;

    @ApiModelProperty(value = "格式化时长")
    private String formatElapsedTime;

    public String getFormatElapsedTime() {
        return DateUtil.formatBetween(this.elapsedTime);
    }
}
